<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddCollaborationUuidToProcessRequestsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('process_requests', function (Blueprint $table) {
            // add collaboration_uuid column
            $table->uuid('collaboration_uuid')->nullable()->after('process_collaboration_id');
            $table->index('collaboration_uuid', 'idx_collaboration_uuid');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('process_requests', function (Blueprint $table) {
            // drop collaboration_uuid column
            $table->dropColumn('collaboration_uuid');
        });
    }
}
